(global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/xgadmin/admin_add" ], {
    "0e48": function(e, t, i) {
        "use strict";
        i.r(t);
        var n = i("217f"), a = i("bb41");
        for (var s in a) "default" !== s && function(e) {
            i.d(t, e, function() {
                return a[e];
            });
        }(s);
        i("2821");
        var o = i("f0c5"), r = Object(o.a)(a.default, n.b, n.c, !1, null, null, null, !1, n.a, void 0);
        t.default = r.exports;
    },
    "217f": function(e, t, i) {
        "use strict";
        i.d(t, "b", function() {
            return a;
        }), i.d(t, "c", function() {
            return s;
        }), i.d(t, "a", function() {
            return n;
        });
        var n = {
            gracePage: function() {
                return i.e("graceUI/components/gracePage").then(i.bind(null, "1915"));
            },
            graceFullLoading: function() {
                return i.e("graceUI/components/graceFullLoading").then(i.bind(null, "7669"));
            },
            divider: function() {
                return i.e("components/divider/divider").then(i.bind(null, "bdb7"));
            },
            graceNumberBox: function() {
                return i.e("graceUI/components/graceNumberBox").then(i.bind(null, "6774"));
            },
            graceSelectImgAndUpload: function() {
                return Promise.all([ i.e("common/vendor"), i.e("graceUI/components/graceSelectImgAndUpload") ]).then(i.bind(null, "d7ef"));
            },
            graceDialog: function() {
                return i.e("graceUI/components/graceDialog").then(i.bind(null, "8d15"));
            },
            graceEmptyNew: function() {
                return i.e("graceUI/components/graceEmptyNew").then(i.bind(null, "fb2f"));
            }
        }, a = function() {
            this.$createElement, this._self._c;
        }, s = [];
    },
    2821: function(e, t, i) {
        "use strict";
        var n = i("bc28");
        i.n(n).a;
    },
    a85f: function(e, t, i) {
        "use strict";
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            i("4e1e"), t(i("66fd")), e(t(i("0e48")).default);
        }).call(this, i("543d").createPage);
    },
    bb41: function(e, t, i) {
        "use strict";
        i.r(t);
        var n = i("f557"), a = i.n(n);
        for (var s in n) "default" !== s && function(e) {
            i.d(t, e, function() {
                return n[e];
            });
        }(s);
        t.default = a.a;
    },
    bc28: function(e, t, i) {},
    f557: function(e, t, i) {
        "use strict";
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var i = {
                data: function() {
                    return {
                        list: [],
                        childList: [],
                        attach: "",
                        isRelease: 0,
                        show2: !0,
                        graceFullLoading: !0,
                        pid: 0,
                        cid: 0,
                        catename: "选择分类",
                        itemname: "选择服务",
                        teckname: "{{teckname}}",
                        demand: "",
                        orderAddrId: 0,
                        addressDetail: {},
                        orderDate: "",
                        orderTime: "",
                        uploadServerUrl: "",
                        marketprice: 0,
                        payprice: "",
                        uploadData: {},
                        minipay: 10,
                        content: "",
                        isWxPay: !1,
                        tmplIds: [],
                        showTextArea: !1,
                        iphonexHeight: 0,
                        addrprovince: 0,
                        itemList: [],
                        show3: !1,
                        itemid: 0,
                        issku: 0,
                        skuname: "",
                        currentSpec: 0,
                        username: "",
                        mobile: "",
                        province: "",
                        district: "",
                        latlng: "",
                        address: "",
                        tecknameBtn: "",
                        perid: 0,
                        ispay: 0,
                        showBack: !1,
                        itemindex: 0,
                        selectNum: 1,
                        defaultPrice: 0,
                        reFresh: !0
                    };
                },
                onLoad: function() {
                    var e = getCurrentPages();
                    this.showBack = e.length > 1;
                    var t = this.$systemInfo.info();
                    this.iphonexHeight = t.iPhoneXBottomHeightPx, this.uploadServerUrl = this.$xRequest.url("entry/wxapp/v4uploadimg"), 
                    this.getinfo();
                },
                onShow: function() {
                    var t = this;
                    e.$once("timeadmin", function(e) {
                        t.orderDate = e.orderDate, t.orderTime = e.orderTime;
                    }), e.$once("selectTeck", function(e) {
                        t.perid = e.perid, 0 == e.perid ? t.tecknameBtn = "系统派单" : t.tecknameBtn = "已选" + t.teckname + e.pername;
                    });
                },
                methods: {
                    changemaxNum: function(e) {
                        this.selectNum = e[0], this.marketprice = this.accMul(this.selectNum, this.defaultPrice);
                    },
                    accMul: function(e, t) {
                        var i = 0, n = e.toString(), a = t.toString();
                        try {
                            i += n.split(".")[1].length;
                        } catch (e) {}
                        try {
                            i += a.split(".")[1].length;
                        } catch (e) {}
                        return Number(n.replace(".", "")) * Number(a.replace(".", "")) / Math.pow(10, i);
                    },
                    toAdmin: function() {
                        e.reLaunch({
                            url: "admin_center"
                        });
                    },
                    chooseLocation: function() {
                        var t = this;
                        e.getSetting({
                            success: function(i) {
                                0 == i.authSetting["scope.userLocation"] ? e.openSetting({
                                    success: function(i) {
                                        1 == i.authSetting["scope.userLocation"] ? (console.log("重新地址授权"), e.chooseLocation({
                                            success: function(e) {
                                                t.province = e.address, t.district = e.name, t.addrprovince = 1, t.latlng = e.latitude + "," + e.longitude;
                                            }
                                        })) : e.showModal({
                                            title: "提示",
                                            content: "请允许使用位置权限",
                                            success: function(e) {
                                                e.confirm ? t.chooseLocation() : e.cancel && console.log("用户点击取消");
                                            }
                                        });
                                    }
                                }) : e.chooseLocation({
                                    success: function(e) {
                                        t.province = e.address, t.district = e.name, t.addrprovince = 1, t.latlng = e.latitude + "," + e.longitude;
                                    }
                                });
                            }
                        });
                    },
                    clearAllImgs: function() {
                        this.$refs.selectimgandupload.clearAllImgs();
                    },
                    imgsChange: function(e) {
                        this.selectedimgs = e;
                    },
                    uploaderror: function() {
                        console.log("上传过程遇到错误");
                    },
                    imgLoaded: function(e) {
                        var t = new Array();
                        if (e.length > 0) {
                            for (var i = 0; i < e.length; i++) t[i] = e[i].url;
                            var n = t.join(",");
                            console.log("提交中"), this.confirmPay(n);
                        } else this.confirmPay("");
                    },
                    confirmPay: function(t) {
                        var i = this;
                        e.showModal({
                            content: "确认提交吗?",
                            complete: function(n) {
                                if (n.confirm) {
                                    e.showLoading({
                                        title: "提交中",
                                        mask: !0
                                    }), i.isWxPay = !0;
                                    var a = i.$xSign.sign("v4adminadd");
                                    i.$xRequest.request({
                                        url: "entry/wxapp/v4adminadd",
                                        data: {
                                            xgsign: a,
                                            op: "addorder",
                                            marketprice: i.marketprice,
                                            addrid: 0,
                                            addrusername: i.username,
                                            addrmobile: i.mobile,
                                            addrname: i.district,
                                            addrdetail: i.province,
                                            addraddress: i.address,
                                            addrlatlng: i.latlng,
                                            orderDate: i.orderDate,
                                            orderTime: i.orderTime,
                                            orderRemarks: i.demand,
                                            pid: i.pid,
                                            cid: i.cid,
                                            itemid: i.itemid,
                                            issku: i.issku,
                                            skuid: i.currentSpec,
                                            skuname: i.skuname,
                                            uploadimgs: t,
                                            perid: i.perid,
                                            ispay: i.ispay,
                                            selectnum: i.selectNum
                                        },
                                        success: function(t) {
                                            e.hideLoading(), 1 == JSON.parse(i.$Decrypt(t.data.data)).status && (e.showToast({
                                                title: "提交成功",
                                                icon: "none"
                                            }), setTimeout(function() {
                                                e.reLaunch({
                                                    url: "xgadmin"
                                                });
                                            }, 1800));
                                        },
                                        fail: function(t) {
                                            i.isWxPay = !1, e.hideLoading(), e.showToast({
                                                title: t.data.message,
                                                icon: "none"
                                            });
                                        }
                                    });
                                } else console.log("取消提交");
                            }
                        });
                    },
                    confirmSubmit: function(t) {
                        this.ispay = t.detail.value.ispay, 0 != this.pid && 0 != this.cid ? 0 != this.itemid ? "" != this.orderTime && null != this.orderTime ? this.username ? /(^1[3|4|5|6|7|8|9][0-9]{9}$)/.test(this.mobile) ? this.district ? this.address ? this.$refs.selectimgandupload.upload() : e.showToast({
                            title: "请填写门牌号信息",
                            icon: "none",
                            duration: 800
                        }) : e.showToast({
                            title: "请在地图选择所在位置",
                            icon: "none",
                            duration: 800
                        }) : e.showToast({
                            title: "请输入正确的手机号码",
                            icon: "none",
                            duration: 800
                        }) : e.showToast({
                            title: "请填写联系人",
                            icon: "none",
                            duration: 800
                        }) : e.showToast({
                            title: "请选择服务时间",
                            icon: "none",
                            duration: 800
                        }) : e.showToast({
                            title: "请选择服务项目",
                            icon: "none"
                        }) : e.showToast({
                            title: "请选择服务分类",
                            icon: "none"
                        });
                    },
                    getCateId: function(t) {
                        var i = this;
                        this.pid = t.currentTarget.dataset.pid, this.cid = t.currentTarget.dataset.cid, 
                        this.itemList = [], this.itemid = 0, this.itemname = "选择服务", this.issku = 0, this.currentSpec = 0, 
                        this.skuname = "", this.marketprice = 0, this.catename = t.currentTarget.dataset.pname + " / " + t.currentTarget.dataset.name, 
                        this.closeDialog2(), e.showLoading({
                            mask: !0,
                            title: "加载中"
                        });
                        var n = this.$xSign.sign("v4adminadd");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4adminadd",
                            data: {
                                xgsign: n,
                                cid: this.cid,
                                op: "getitem"
                            },
                            success: function(t) {
                                var n = JSON.parse(i.$Decrypt(t.data.data));
                                e.hideLoading(), i.itemList = n.items, 0 == i.itemList.length ? e.showToast({
                                    icon: "none",
                                    title: "分类下没有相关服务,请重新选择"
                                }) : i.show3 = !0;
                            }
                        });
                    },
                    confirmItem: function(e) {
                        var t = this;
                        this.reFresh = !1, this.itemid = e.currentTarget.dataset.itemid, this.itemindex = e.currentTarget.dataset.itemindex, 
                        this.show3 = !1, 1 == e.currentTarget.dataset.issku ? (this.issku = 1, this.marketprice = e.currentTarget.dataset.skuprice, 
                        this.currentSpec = e.currentTarget.dataset.skuid, this.skuname = e.currentTarget.dataset.specname, 
                        this.itemname = e.currentTarget.dataset.itemtitle) : (this.issku = 0, this.itemname = e.currentTarget.dataset.itemtitle, 
                        this.marketprice = e.currentTarget.dataset.price), this.defaultPrice = this.marketprice, 
                        this.$nextTick(function() {
                            t.reFresh = !0;
                        });
                    },
                    selectTime: function() {
                        0 != this.itemid ? e.navigateTo({
                            url: "../getdate/getdate?admin=1&item=" + this.itemid
                        }) : e.showToast({
                            mask: !0,
                            icon: "none",
                            title: "请先选择服务项目"
                        });
                    },
                    getTeck: function() {
                        "" != this.latlng ? e.navigateTo({
                            url: "../getteck/getteck?lt=" + this.latlng + "&iid=" + this.itemid + "&ad=1"
                        }) : e.showToast({
                            mask: !0,
                            icon: "none",
                            title: "请先选择地址"
                        });
                    },
                    showDialog2: function() {
                        this.show2 = !0;
                    },
                    closeDialog2: function() {
                        this.show2 = !1;
                    },
                    showDialog3: function() {
                        this.show3 = !0;
                    },
                    closeDialog3: function() {
                        this.show3 = !1;
                    },
                    confirm2: function() {
                        this.closeDialog2(), e.showToast({
                            title: "您点击了确认按钮",
                            icon: "none"
                        });
                    },
                    getinfo: function() {
                        var t = this, i = this.$xSign.sign("v4adminadd");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4adminadd",
                            data: {
                                xgsign: i,
                                op: "getinfo"
                            },
                            success: function(e) {
                                var i = JSON.parse(t.$Decrypt(e.data.data));
                                0 == e.data.errno && 1 == i.isrelease && (t.graceFullLoading = !1, t.isRelease = i.isrelease, 
                                t.attach = i.attach, t.list = i.parent, t.childList = i.child, t.teckname = i.teckname, 
                                t.tecknameBtn = "选择" + i.teckname, setTimeout(function() {
                                    t.showTextArea = !0;
                                }, 20));
                            },
                            fail: function(t) {
                                e.showToast({
                                    title: "没有管理权限",
                                    icon: "none"
                                }), setTimeout(function() {
                                    e.reLaunch({
                                        url: "../index/index"
                                    });
                                }, 1800);
                            }
                        });
                    }
                }
            };
            t.default = i;
        }).call(this, i("543d").default);
    }
}, [ [ "a85f", "common/runtime", "common/vendor" ] ] ]);